import request from '@/utils/request';
import { Submission, UpdateSubmissionRequest } from '@/types/submission';
import { PaginationResponse, PaginationParams } from '@/types/api-common';

export interface SubmissionPageRequest extends PaginationParams {
  siteName?: string;
  category?: string;
  status?: number;
  email?: string;
}

// 分页获取提交列表
export const getSubmissionList = async (params: SubmissionPageRequest): Promise<PaginationResponse<Submission>> => {
  return request.post('/api/admin/submissions/page', params);
};

// 更新提交状态
export const updateSubmission = async (params: UpdateSubmissionRequest): Promise<{ success: boolean; message: string }> => {
  return request.post('/api/admin/submissions/update', params);
};